<template>
	<view>
		<!-- <view style="border: 1rpx solid darkgray;">
			<view style="margin: 10px;">站点 区间 施工内容 负责人</view>
		</view> -->
		<view style="border: 1rpx solid darkgray;">
			<view style="margin: 10px;">施工后完工</view>
		</view>
		
		<form @submit="onSubmit">
		<uni-card :is-shadow="true" is-full style="margin-top: 15px;">
		<uni-list>
			<view style=" border: 1rpx solid darkgray; display: flex; align-items: center;">
			  <view style="margin: 10px;">施工申请单id</view>
			  <view style="flex: 1;"></view> <!-- 占位符，将按钮推到右边 -->
			  <view class="example-body" style="display: flex; align-items: center;">
			    <input type="text" name="formId" v-model="formData.formId" placeholder="请输入施工申请单id" />
			  </view>
			</view>
			
			<view style=" border: 1rpx solid darkgray; display: flex; align-items: center;">
			  <view style="margin: 10px;">令号</view>
			  <view style="flex: 1;"></view> <!-- 占位符，将按钮推到右边 -->
			  <view class="example-body" style="display: flex; align-items: center;">
			    <input type="text" name="formCode" v-model="formData.formCode" placeholder="请输入令号" />
			  </view>
			</view>
			
			
			<view style=" border: 1rpx solid darkgray; display: flex; align-items: center;">
			  <view style="margin: 10px;">施工前工器具清点单</view>
			  <view style="flex: 1;"></view> <!-- 占位符，将按钮推到右边 -->
			  <view class="example-body" style="display: flex; align-items: center;">
			    <input type="text" name="instrumentCheckList" v-model="formData.instrumentCheckList" placeholder="请输入故障" />
			  </view>
			</view>
			
			<view style="border: 1rpx solid darkgray; display: flex; align-items: center;">
			  <view style="margin: 10px;">施工前工器具现场照片</view>
			  <view style="flex: 1;"></view> <!-- 占位符，将按钮推到右边 -->
			  <view class="example-body" style="display: flex; align-items: center;">
			    <uni-file-picker limit="9" file-mediatype="photo"></uni-file-picker>
			  </view>
			</view>
			
			<view style="border: 1rpx solid darkgray; display: flex; align-items: center;">
			  <view style="margin: 10px;">车辆检查照片</view>
			  <view style="flex: 1;"></view> <!-- 占位符，将按钮推到右边 -->
			  <view class="example-body" style="display: flex; align-items: center;">
			    <uni-file-picker limit="9" file-mediatype="photo"></uni-file-picker>
			  </view>
			</view>
			
			<view style="border: 1rpx solid darkgray; display: flex; align-items: center;">
			  <view style="margin: 10px;">接地线挂设（选填）</view>
			  <view style="flex: 1;"></view> <!-- 占位符，将按钮推到右边 -->
			  <view class="example-body" style="display: flex; align-items: center;">
			    <uni-file-picker limit="9" file-mediatype="photo"></uni-file-picker>
			  </view>
			</view>
			
			<view style=" border: 1rpx solid darkgray; display: flex; align-items: center;">
			  <view style="margin: 10px;">班后总结</view>
			  <view style="flex: 1;"></view> <!-- 占位符，将按钮推到右边 -->
			  <view class="example-body" style="display: flex; align-items: center;">
			    <input type="text" name="summary" v-model="formData.summary" placeholder="请输入风险源" />
			  </view>
			</view>
			
		</uni-list>
		</uni-card>
		
		<button form-type="submit" type="primary" style="margin: 10px;">提交</button>
		</form>
	</view>
</template>

<script>
	import axios from "axios"
	import { title } from "process";
	export default {
		data() {
			return {
				formData: {
					    formId:'',
						formCode:'',
						safeTechFault:'',
						safeTechHiddenDanger:'',
				        instrumentCheckList:'',
						instrumentCheckListPhoto:'',
						vehicleCheckPhoto:'',
						groundConnectionPhoto:''
				}
			};
		},
		methods: {
			onSubmit(e) {
			      e.preventDefault(); // 防止表单默认提交
				  console.log("test")
			      // console.log(e.target.detail.value);
			      // this.obj = e.target.detail.value;
				  axios.post("http://localhost:82/endingAfterConstruction/management",this.formData)
				  .then((data)=>{
					  console.log(data)
					  uni.navigateTo({
					              url: '/pages/constructionprocess/constructionprocess?update3=true'
					            });
				  }).catch((err)=>{
					  console.log(err)
				  })
				  
			    },
		}
	}
</script>

<style>
	.example-body{
		  margin: 10px;
		  height: 1cm;
		  border: 1px;
		  box-sizing: border-box;
		  
	}
</style>
